package com.raojunxue.company.action.talk;

import org.apache.struts2.rest.DefaultHttpHeaders;
import org.apache.struts2.rest.HttpHeaders;

import com.raojunxue.company.action.AbstractAction;
import com.raojunxue.company.util.XMPPUtil;

public class SendAction extends AbstractAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = -548442423860025064L;

	private String username;
	
	private String content;
	
	public void setUsername(String username) {
		this.username = username;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Override
	public HttpHeaders create() {
		XMPPUtil.sendMessage(this.username, this.content);
		redirect();
		return null;
	}

	@Override
	public String destroy() {
		return null;
	}

	@Override
	public String edit() {
		return null;
	}

	@Override
	public HttpHeaders editNew() {
		return null;
	}

	@Override
	public HttpHeaders index() {
		return new DefaultHttpHeaders("index").disableCaching();
	}

	@Override
	public HttpHeaders show() {
		return null;
	}

	@Override
	public String update() {
		return null;
	}

}
